<?php
$view_post = '<div id="video_home">';
$video = $tc->home_video();
$i=0;
while($row_video = mysql_fetch_array($video)){
	$i++;
	if($i!=1) $view_post .= '<a href="'.$tc->link_detail($row_video['menu_id']).$row_video['name_rewrite'].'.html">+ '.$row_video['name'].'</a>';
	else $view_post .= '<iframe src="'.$row_video['link_video'].'?origin='.$domain.'&rel=0" frameborder="0"></iframe><div id="video_new">
	<a href="'.$tc->link_detail($row_video['menu_id']).$row_video['name_rewrite'].'.html">+ '.$row_video['name'].'</a>';
}
$view_post .= '</div></div><div style="clear:both; height:30px"></div>';

$list = $tc->home_chuongtrinh(3);
$view_post .= '<div id="tuvan_sk"><h4 style="color:#F00; font-size:20px; font-weight:bold; line-height:35px; margin:0 20px">Chương trình đào tạo</h4>';
while($row = mysql_fetch_array($list)){
	$link_detail = $tc->link_detail($row['menu_id']);
	($row['url_hinh']!='') ? $image=url_articles_thumb_image.$row['url_hinh'] : $image=url_no_image;
	$view_post .= '
	<div class="item_info">
		<a href="'.$link_detail.$row['name_rewrite'].'.html"><img src="'.$image.'" alt="'.$row['name'].'" />
		<h3>'.$row['name'].'</h3></a>
		<div>'.$row['description'].'</div>
	</div>';
}
$view_post .= '<div style="clear:both; height:1px"></div></div>';

$view_post .= '<div id="other">';
$other = $tc->slider_baner(6);
while($row_other = mysql_fetch_array($other)){
	$view_post .= '<div class="item"><h2>'.$row_other['name'].'</h2><div class="content"><a href="'.$row_other['link'].'" title="'.$row_other['name'].'"><img src="public/images/slider/'.$row_other['url_hinh'].'" alt="'.$row_other['name'].'" /></a></div></div>';
}
$view_post .= '<div style="clear:both; height:1px"></div></div>';

$list = $tc->home_chuongtrinh(5);
$view_post .= '<div id="tuvan_sk"><h4 style="color:#F00; font-size:20px; font-weight:bold; line-height:35px; margin:0 20px; padding-top:35px">Tin tức - Sự kiện</h4>';
while($row = mysql_fetch_array($list)){
	$link_detail = $tc->link_detail($row['menu_id']);
	($row['url_hinh']!='') ? $image=url_articles_thumb_image.$row['url_hinh'] : $image=url_no_image;
	$view_post .= '
	<div class="item_info">
		<a href="'.$link_detail.$row['name_rewrite'].'.html"><img src="'.$image.'" alt="'.$row['name'].'" />
		<h3>'.$row['name'].'</h3></a>
		<div>'.$row['description'].'</div>
	</div>';
}
$view_post .= '<div style="clear:both; height:1px"></div></div>';